<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" 
	template="/template/template.xhtml">

  <ui:define name="center">
  <h1 class="title ui-widget-header ui-corner-all">
  <h:outputText value="#{msg['category.title']} #{bookListBean.searchCategory.title}"/>
  </h1>	  

  <h:form id="bestsellers">
   <p:dataGrid var="book" value="#{bookListBean.books}" columns="3"  
        rows="12" paginator="false"  
        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        rowsPerPageTemplate="9,12,15">  
        <p:column>  
            <p:panel style="text-align:center">  
            <div class="ui-panel-titlebar ui-widget-header ui-corner-all link-title">
            	<h:commandLink class="title" action="bookDetail">
               		<f:setPropertyActionListener target="#{bookBean.book}" value="#{book}" />	  
               		<h:outputText value="#{book.title}" />
                 </h:commandLink>
            </div>
                <h:panelGrid columns="1" style="width:100%">
			  	   <p:graphicImage value="#{bookBean.coverPath}#{book.id}"/>    
                   <h:outputText value="#{book.price}€" />
                    <h:outputText value="${item.name}"/><br/>
                </h:panelGrid>  
            </p:panel>  
        </p:column>  
  
    </p:dataGrid>
  </h:form> 
  </ui:define>
</ui:composition>